// Load dialog on click
$(document).ready(function(){
	$('#basic-modal a').click(function (e) {	   
	var menu = $(this).html();	
	var top, left;
	var cover_link = '#';
	var slot_drain = '#';
	var position = 'absolute';
	var id_name = 'basic-modal-gatic-access';
	var drain_id = 'gatic_slotdrain_details';
	var access_id = 'gatic_cover_details';		
	switch(menu)
	{
	case 'Testimonials':
		top = '60%';
		left = '337px';
		cover_link = 'slotcover_testimonial.html';
		slot_drain = 'slotdrain_testimonial.html';
		id_name = 'basic-modal-content';
		drain_id = 'gatic_slotdrain';
		access_id = 'gatic_cover';
	  break;
	case 'Technical Support':
		top = '50%';
		left = '360px';
		cover_link = 'access_covers_tech_support.html';
		slot_drain = 'about.html';		
	  break;
	case 'Applications':		
		top = '35%';
		left = '337px';		
		cover_link = 'access_covers_load_cat.html';
		slot_drain = 'slotdrain_view_by_app.html';	
	  break;
	case 'Product Selector':	
		top = '40%';
		left = '345px';		
        cover_link = 'access_covers_load_cat.html';
        slot_drain = 'product_selector.html';                
	  break;
	case 'Features &amp; Benefits':	 		
		top = '45%';
		left = '360px';		
        cover_link = 'access_covers_features_benifits.html';
        slot_drain = 'ultraslot_features_benefits.html';        
	  break;
	case 'Downloads':	
		top = '55%';
		left = '337px';		
		cover_link = 'accesscover_downloads.html';
        slot_drain = 'slotdrain_downloads.html'; 		
	  break;
	case 'Case Studies':	
		top = '65%';
		left = '337px';		
	  break;
	case 'Company':	
		return true;	
	  break;
    case 'Home':
        return true;
	break;
	case 'My Gatic - log in':
		top = '65%';
		left = '337px';	
	break;
	default:
		top = '62%';
		left = '337px';	
	break;		
	}

	if( $(this).html() != 'Contact' && $(this).html() != 'My Gatic - log in') // && $(this).html() == 'Testimonials'
	{	
		$('#'+id_name).modal();
			
		$('#simplemodal-container').css('top',top);
		$('#simplemodal-container').css('left',left);
		$('#simplemodal-container').css('position',position);
		
		/* If the covers radio button clicked */
		$('#'+access_id).click(function (e) {
			window.location.href=cover_link;
		});
		/* If the covers radio button clicked */
		$('#'+drain_id).click(function (e) {
			window.location.href=slot_drain;
		});
		return false;
	}
	else if($(this).html() == 'My Gatic - log in')
	{
		$('#gatic_login_block').css('display','block');
		return false;
	}
	else if( $(this).html() == 'Contact')
	{
		
	}
	else
	{	
		return true;
	}
		
	});
})        